
<?php
     include_once('Models/NguoiDung.php');
	 include_once('Models/NguoiQuanTri.php');
	 include_once('Models/CanBoDaoTao.php');
	 include_once('Models/CanBoGiangDay.php');
	 include_once('Models/SinhVien.php');
	 $maquyen = $_SESSION['nmaquyen'];
	 
	 $result = "";
	 
	 if ($maquyen == 'AD'){
	 	$ad = new NguoiQuanTri();
		$ad->setMaSo($_SESSION['nmaso']);
		$result = $ad->thongTinNguoiQuanTri();
	 }
	 else if ($maquyen == 'DT'){
	 	$dt = new CanBoDaoTao();
		$dt->setMaSo($_SESSION['nmaso']);
		$result = $dt->thongTinCanBoDaoTao();
	 }
	 else if ($maquyen == 'SV'){
	 	$sv = new SinhVien();
		$sv->setMaSo($_SESSION['nmaso']);
        $result = $sv->thongtinSinhVien();
	 }
     else{
        $cbgd = new CanBoGiangDay();
        $cbgd->setMaSo($_SESSION['nmaso']);
        $result = $cbgd->thongTinCanBoGiangDay();
        
     }
	 
     /*$user = new NguoiDung();
     $user->setMaSo($_SESSION['nmaso']);
     $sql = "select a.maso, concat(holot,' ',ten) as hoten, date_format(ngaysinh, '%d-%m-%Y') as ngaysinh,
	 		(case phai when 0 then N'Nữ' when 1 then 'Nam' end) as phai, diachi, email, sodt from NguoiDung a, CanBo b";
     $sql .= " where  a.maso='".$user->getMaSo()."' and a.maso = b.maso";
     $user->setQuery($sql);
     $result = $user->fetchAll();*/
     require('Views/Thongtincanhan.php');
     /*$result = $nd->thongtinCanBo();
     require('Views/Thongtincanhan.php');*/
     
?>                                                                          
